//
//  OPVideoHeadView.m
//  OnePiece
//
//  Created by wsy on 15/10/26.
//  Copyright © 2015年 wsy. All rights reserved.
//

#import "OPVideoHeadView.h"

//@interface OPVideoHeadView ()<UIScrollViewDelegate>
//
//@end


@implementation OPVideoHeadView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        UIScrollView *headScr = [[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_WIDTH/2)];
        headScr.contentSize = CGSizeMake(SCREEN_WIDTH*5, SCREEN_WIDTH/2);
        headScr.pagingEnabled = YES;
        headScr.bounces = NO;
//        headScr.delegate = self;
        headScr.showsHorizontalScrollIndicator = NO;
        [self addSubview:headScr];
        UIPageControl *pageControl = [[UIPageControl alloc]initWithFrame:CGRectMake(SCREEN_WIDTH - 100, SCREEN_WIDTH/2 - 30, 100, 30)];
        pageControl.numberOfPages = 3;
        [self addSubview:pageControl];
        
        UIImageView *imgView1 = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_WIDTH/2)];
        imgView1.image = [UIImage imageNamed:@"videoHead3"];
        [headScr addSubview:imgView1];
        UIImageView *imgView2 = [[UIImageView alloc]initWithFrame:CGRectMake(SCREEN_WIDTH, 0, SCREEN_WIDTH, SCREEN_WIDTH/2)];
        imgView2.image = [UIImage imageNamed:@"videoHead1"];
        [headScr addSubview:imgView2];
        UIImageView *imgView3 = [[UIImageView alloc]initWithFrame:CGRectMake(SCREEN_WIDTH*2, 0, SCREEN_WIDTH, SCREEN_WIDTH/2)];
        imgView3.image = [UIImage imageNamed:@"videoHead2"];
        [headScr addSubview:imgView3];
        UIImageView *imgView4 = [[UIImageView alloc]initWithFrame:CGRectMake(SCREEN_WIDTH*3, 0, SCREEN_WIDTH, SCREEN_WIDTH/2)];
        imgView4.image = [UIImage imageNamed:@"videoHead3"];
        [headScr addSubview:imgView4];
        UIImageView *imgView5 = [[UIImageView alloc]initWithFrame:CGRectMake(SCREEN_WIDTH*4, 0, SCREEN_WIDTH, SCREEN_WIDTH/2)];
        imgView5.image = [UIImage imageNamed:@"videoHead1"];
        [headScr addSubview:imgView5];
        
    }
    return  self;
}







@end
